# -*- coding:utf-8 -*-
'''
Created on 2011-9-19

@author: tanfeng
'''

import os,sys

from DBConnector import DBConnection

db = DBConnection()
cur = db.cur
conn = db.conn

def import_insurance():
    # 中资
    names = ['人保股份京分','大地财产京分','出口信用京分（虚拟）','中华联合京分','太保财京分','平安财京分','华泰京分','天安京分','华安京分','永安京分','太平保险京分','民安京分','中银保险京分','永诚京分','安邦京分','信达财险京分','安华农业京分','天平车险京分','阳光财产京分','都邦京分','渤海京分','华农京分','国寿财产京分','安诚京分','长安责任京分','英大财产京分（虚拟）','浙商财产京分','紫金财产京分']
    sql = ''' 
        insert into ag_insurance (insurance_company,insurance_type,area) values ('%s', %s, 'bj')
    '''
    for n in names:
        cur.execute(sql % (n, 1))
    conn.commit()
    
    # 外资
    names = ['美亚京分','太阳联合京分','三井京分','三星京分','利宝互助京分','苏黎世京分（虚拟）','现代财产京分（虚拟）','中意财产京分（虚拟）']
    for n in names:
        cur.execute(sql % (n ,2))
    conn.commit()

import_insurance()

print 'finished...'